//
//  LYMineCircleViewController.m
//  artist
//
//  Created by Jay_Apple on 16/5/12.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYMineCircleViewController.h"
#import "LYArtViewController.h"
#import "LYCircleListModel.h"

@interface LYMineCircleViewController ()

@end

@implementation LYMineCircleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self getCircles];
}

/**
 *  获取圈子
 */
- (void)getCircles{
    
    [MBProgressHUD showMessage:nil];
    [LYRequestTool acquirCircleListWithToken:LYToken type:@"join" success:^(NSArray<LYCircleListModel *> *circles) {
        [MBProgressHUD hideHUD];
        NSMutableArray *circleVCs = [NSMutableArray array];
        
        for (LYCircleListModel *model in circles) {
            
            LYArtViewController *art = [[LYArtViewController alloc] init];
            art.model = model;
            [circleVCs addObject:art];
            
        }
        
        self.childVCs = circleVCs;
        
        
    } failure:^(NSString *code, NSString *message) {
        
        [MBProgressHUD hideHUD];
        
    }];
    
}




@end
